﻿/*****************************************************
**Copyright(C), 2021-2022, Ciqtek Technology.
**Version:     dev
**Author:      MiPeng
**Date:        2021/12/23
**Description: 可点击富文本标签
*****************************************************/

#ifndef RICHTEXTBUTTON_H
#define RICHTEXTBUTTON_H

#include "../generalui_global.h"
#include "../GlobalUIDef.h"

#include <QLabel>

namespace GeneralUI {

	class GENERALUI_EXPORT ClickableLabel : public QLabel
	{
		Q_OBJECT

	public:
		explicit ClickableLabel(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
		explicit ClickableLabel(QString &text, QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
		~ClickableLabel();

	Q_SIGNALS:
		/**
		 * @brief  clicked  标签点击信号
		 * @return void
		 */
		void clicked();

	protected:
		/**
		 * @brief  mousePressEvent  鼠标点击事件
		 * @param  event
		 * @return void
		 */
		void mousePressEvent(QMouseEvent *event) override;
	};

}//namespace OfUI

#endif // RICHTEXTBUTTON_H
